<?php
/*
 * @Author: CHINAKAIYUAN<sunkaiyuan@namenode.cn>
 * @Date: 2022-02-03 00:33:05
 * @LastEditTime: 2023-05-06 00:05:39
 * @LastEditors: 孙开源 && sunkaiyuan@namenode.cn
 * @Description: 工序产量
 */

namespace App\Models;

use App\Traits\AutoCodeTrait;
use App\Traits\CommonUserTrait;



class ProProcessRoute extends BaseModel
    {
    use CommonUserTrait;
    use AutoCodeTrait;
    public $timestamps = true;
    public $table = "basedata_pro_process_route";
    protected $guarded = [];
    // 

    public $ACSign = "PROCESS_ROUTE";
    public function details()
        {
        return $this->hasMany(ProProcessRouteDetails::class, "main_id")->orderBy("sort");
        }

    public function status()
        {
        return $this->belongsTo(Dic::class, "status_id", "key")->where(function ($q)
            {
            $q->where("code", 'table_status');
            });
        }
    }
